<?php
require_once 'connect.php';

if (isset($_POST) && isset($_POST['gameName']) && isset($_POST['username']) && isset($_POST['reviewBody']) && isset($_POST['rating'])) {
	$gameName= $_POST['gameName'];
	$username= $_POST['username'];
	$reviewBody= $_POST['reviewBody'];
	$rating= $_POST['rating'];

	// create the account
	connect();
	if (sendComment($username, $gameName, $reviewBody, $rating )) {
		echo 'true';
	} else {
		echo 'false';
	}
} else {
	echo 'Unable to send comment.';
}
?>